<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>分配权限</title>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
	$(function()
	{
		$('input').click(function()
			{
				var level=$(this).attr('level');
				if(level==1)
				{
					var str='_';
					var inputs=$('input[value*='+str+']');
					$(this).attr('checked')?inputs.attr('checked',true):inputs.removeAttr('checked');
				}
		});	
	});


/*$(function(){
	$('input[level=1]').click(function(){
		var inputs=$(this).parents('.app').find('input');
		$(this).attr('checked') ? inputs.attr('checked','checked') : inputs.removeAttr('checked');
	});
	$('input[level=2]').click(function(){
		var inputs=$(this).parents('dl').find('input');
		$(this).attr('checked') ? inputs.attr('checked','checked') : inputs.removeAttr('checked');
	});
});*/
</script>
</head>

<body>
<form action="{:U('admin/RBAC/setAccess')}" method="post">
	<div id="wrap">
		<a href="{:U('admin/RBAC/relo')}" class="add-app">返回</a>
		<div style="text-indent: 20px">你当前的用户组为:<span style="font-weight:bold;font-size: 15px;color:blue">{$name}</span></div>
		<volist name="nodelist" id="vo">
				<p style="text-indent:{$vo['level']*30}px;<if condition="$vo.level eq 3">float:left;margin-right:-40px;<else/>clear:both;</if>">
				<input id="{$vo.id}" type="checkbox" name="access[]" value="{$vo.id}_{$vo.level}" pid="{$vo.pid}" level="{$vo.level}"<if condition="$vo['access']">checked='checked'</if>/>
					<if condition="$vo.level eq 1"><span style="font-weight: bold">【项目】</span><elseif condition="$vo.level eq 2"/><span>【模块】</span></if>
					<lebel name="name" value="{$vo.id}">{$vo['title']}</lebel>
				</p>
				</volist>
		
	</div>
	<input type="hidden" name="id" value="{$id}">
	<input type="submit" value="保存修改" style="display:block; margin:20px auto; cursor:pointer"/>
	</form>
</body>
</html>
